package com.clps.algorithm03.链表;

public class Queue <E>{
    private QueueNode<E> head;//队列的头
    private QueueNode<E> tail;//队列的尾
    private int size;

    public void  add(E val){
        if(isEmpty()){
            head = new QueueNode<>(val,null,null);
            tail = head;
        }else{
            tail = new QueueNode<>(val,null,null);
            tail.pre.next = tail;
        }
        size++;
    }

    private boolean isEmpty() {
        return  size ==0;
    }
}
